<%@page import="javax.xml.namespace.QName"%>
<%@page import="java.net.URL"%>
<%@page import="Proxies.DataUsuario"%>
<%@page import="Proxies.CtrlUsuariosWSService"%>
<%@page import="Proxies.CtrlUsuariosWS"%>
<%@page import="java.util.Date"%>
<%@page import="java.io.PrintWriter"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.ArrayList"%>
<%
    
    String str = request.getParameter("q");
    String hint = "";
    
    String IP = (String) session.getAttribute("SERVIDOR");
    URL dirUsr = new URL(IP + "CtrlUsuarios?wsdl");
    QName qNaUsr = new QName("http://WebServices/", "CtrlUsuariosWSService");
    CtrlUsuariosWS ctrlUsr = new CtrlUsuariosWSService(dirUsr, qNaUsr).getCtrlUsuariosWSPort();
    
    out.write("<table cellspacing=\"0\" cellpadding=\"0\" "+
            "width=\"300px\" style=\"border: solid black; border-width: 1px; border-top: none;width: 305px;\">");
    Iterator<DataUsuario> itera = ctrlUsr.listaUsuarios().getItem().iterator();
    DataUsuario usr = null;
    while (itera.hasNext()){
        usr = itera.next();
        
        if (usr.getCorreo().toUpperCase().startsWith(str.toUpperCase()) || 
                usr.getNick().toUpperCase().startsWith(str.toUpperCase()))
            
            hint += "<tr id=\""+usr.getCorreo()+"\" onmouseover=\"resaltar(\'"+
                    usr.getCorreo()+"\')\" onmouseout=\"quitarResaltar(\'"+
                    usr.getCorreo()+"\')\" onclick=\"seleccionar(\'"+
                    usr.getCorreo()+"\')\"><td>  "+
                    usr.getNombre()+"</td></tr>\n";
    }
    
    out.write(hint);
    out.write("\n</table>");
    
    

%>